package IC.lir.operands;

public class IntImmediate extends ImmOperand {

	private final int val;

	/**
	 * Create an immediate operand from integer value 
	 * @param val the immediate value
	 */
	public IntImmediate(int val) {
		this.val = val;
	}

	/**
	 * Create a 'default' immediate operand 
	 */
	public IntImmediate() {
		this.val = 9999;
	}

	/**
	 * @return operand value
	 */
	public int getVal() {
		return val;
	}

	public String toString() {
		return val+"";
	}
	
	@Override
	public int getPrio() {
		return 0;
	}
	
	public int hashCode() {
		return val ^ getPrio();
	}
}
